package com.zk.bytecode.trace;

import net.bytebuddy.asm.Advice;


/**
 * 类型追踪的拦截器，该拦截器会通过字节码增强形式，被ByteBuddy添加到预定义的方法内
 */
public class TraceInterceptor {
    @Advice.OnMethodEnter
    public static StackTraceManagement methodEnter(
            @Advice.Origin("#m") String method) {
        return TraceMain.enter();
    }

    @Advice.OnMethodExit
    public static void methodExit(@Advice.Origin("#m") String method,
                                  @Advice.Enter StackTraceManagement holder) {
        TraceMain.exit(holder);
    }


}
